package com.lmj.demo.pojo;

import java.util.List;
import java.util.Random;

/**
 * @author: lmj
 * @data: 2020/8/10 14:04
 * @email: limajun97@163.com
 * @description:
 */
public class ReUser extends UserExtendDemo {
    public ReUser() {
    }

    public ReUser(String name, Integer money) {
        super(name, money);
    }

    /**
     * 功能描述: <br>
     * 〈收红包〉
     * @param moneyList
     * @return: void
     * @author: limajun97@163.com
     * @date: 2020/8/10 2:08 下午
     * @throws:
     */
    public void receiveMoney(List<Integer> moneyList) {
        int index = new Random().nextInt(moneyList.size());
        Integer delta = moneyList.remove(index);
        super.setMoney(super.getMoney() + delta);
    }
}
